<style type="text/css">
#main table {
	border-top:1px #666666 solid;
	border-right:1px #666666 solid;
	background:url(../images/line_bg_list.gif) left top repeat;
}
#main table tr:hover td { background: #FFFB82; cursor:pointer; color:#000000;}/*隔行换色鼠标经过效果*/
#main td {
	border-left:1px #666666 solid;
	border-bottom:1px #666666 solid;
	height:29px;
	overflow:hidden;
}
</style>
<table width="90%" style="margin-top:20px;" border="0" align="center" cellpadding="10" cellspacing="0">
	<tr>
		<td>
		<div id="main">
			<h3>评分子项设置</h3>
			<fieldset>
			<table border="0" cellpadding="2" cellspacing="0" style="width: 100%">
					<tr>
						<td width="" align="left" nowrap>
							选择项目:
                         <select name="treeId" id="treeId">
                         <option value="0" selected="selected">请选择评分分项</option>
                             $cateTree
                         </select>													
						&nbsp;
						<label>
							<input type="button" id="selectbtn" value="确定" onclick="javascript:selectItem()";/>
						</label>
					
					   #if($!percent!=0)
					   <span style="color:red">评分项总分为$!percent分，请设置评分子项时保证分值总和与评分项的分值相同</span>
					   #end
					</td>
					</tr>
				</table>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
				  <tr style="color:#FFFFFF">
					<td width="10%" align="center" valign="middle" bgcolor="#333333"><strong>选择</strong></td>
				    <td width="15%" align="center" valign="middle" bgcolor="#333333"><strong>所属项目</strong></td>
				    <td width="50%" align="center" valign="middle" bgcolor="#333333"><strong>评价名称</strong></td>
				    <td width="25%" align="center" valign="middle" bgcolor="#333333"><strong>分值设定</strong></td>
				  </tr>
				 #if($treeOrItem=="tree")
										<form action="/project/addProjectTmpItemNew.do" method="post" id="form1">
										  <input type="hidden" name="projectId" value="$!projectId" />
										  <input type="hidden" name="treeId" value="$!treeId" />
										#foreach($item in $itemList)
				                      <tr align="center">
				                        <td width="10%" height="20" align="center" bgcolor="#FFFFFF">
				                          <input type="checkbox" name="selectItems" value="$!item.id" checked/>
				                        </td>
				                        <td width="10%" bgcolor="#FFFFFF">$!scoreTree.cateName</td>
				                        <td width="49%" align="left" bgcolor="#FFFFFF">$!item.itemName</td>
				                        <td align="center" bgcolor="#FFFFFF"><input name="score" type="text" value="0" /></td>                     
				                      </tr> <!--  //onkeyup="checkInput(this);"  -->
				                      	#end 
				                      	<tr>
				                      	<td bgcolor="#FFFFFF" colspan="4">
				                      	<br>
				                      	#if($itemList.size()>0)<input type="submit" name="save" id="save" value="保存" style="background:url(../images/button-submit.gif) left top no-repeat; border:none; cursor:pointer; width:94px; height:29px; line-height:29px; vertical-align:middle;"/>#end
										<input type="button" name="preview" value="预览" onclick="gopreview()" style="background:url(../images/button-submit.gif) left top no-repeat; border:none; cursor:pointer; width:94px; height:29px; line-height:29px; vertical-align:middle;"/>
										<br>
										</td>
										</tr>
				                      	</form>									  
										#else
										<form action="/project/editProjectTmpItemNew.do" method="post" id="form1">
										  <input type="hidden" name="projectId" value="$!projectId" />
										  <input type="hidden" name="treeId" value="$!treeId" />
										#foreach($entity in $projectItemsList)
										<tr align="center">
				                        <td width="10%" height="20" align="center" bgcolor="#FFFFFF">
				                          <input type="checkbox" name="id" value="$!entity.id" checked/>
				                          <input name="selectItems" type="hidden" value="$!entity.scoreItem.id" />
				                        </td>
				                        <td width="10%" bgcolor="#FFFFFF">$!scoreTree.cateName</td>
				                        <td width="49%" align="left" bgcolor="#FFFFFF">$!entity.scoreItem.itemName</td>
				                        <td align="center" bgcolor="#FFFFFF"><input name="score" type="text" value="$!entity.score" /></td>                       
				                      </tr>  
				                      	 #end
				                      	  <tr>
				                      	<td bgcolor="#FFFFFF" colspan="4">
				                      	<br>
				                      		#if($!projectItemsList.size()>0)
				      						<input type="submit" name="save" id="save" value="修改" style="background:url(../images/button-submit.gif) left top no-repeat; border:none; cursor:pointer; width:94px; height:29px; line-height:29px; vertical-align:middle;"/>
				              			 	#end
			   								<input type="button" name="preview" value="预览" onclick="gopreview()" style="background:url(../images/button-submit.gif) left top no-repeat; border:none; cursor:pointer; width:94px; height:29px; line-height:29px; vertical-align:middle;"/>
										<br>
										</td>
										</tr>	
										#end
				 
				</table>
				<br>
				
			</fieldset>
		
		</div>
		</td>
	</tr>
</table>
</form>
<script language="javascript">
selectedItemp();
function selectItem()
{
	var treeId = document.getElementById("treeId").value;
	if(treeId=="0")
	{
		alert("请选择评分分项！");
	}
	else
	{
		location.href="/project/addNewProject_StepTwoNew.jsp?id=$!projectId&treeId="+treeId;	
	}
}
function selectedItemp()
{
	document.getElementsByName("treeId")[0].value = "$!treeId";
}

function checkInput(o)
{
       var pice = o.value.replace(/^[0-9]+\.?[0-9]{0,2}$/ ,'');
       if(pice.length>0)
       {
         o.value = "";
       }
}
 function gopreview() {
	     location.href="/project/ProjectView.jsp?projectId=$!projectId&treeId=$!treeId";
	   }
</script>